package com.github.baichuan.file.rest.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Slf4j
public class Swagger {
    @Value("${repository.name}")
    private String repository;

    @Bean
    public OpenAPI restOpenApi(){
        log.info("启动Swagger");

        return new OpenAPI()
                .info(new Info().title(repository + "文件微服务接口文档")
                        .version("v1.0.1"));
    }
}
